package com.api.devices.domain.query.score;

import com.alibaba.fastjson2.JSONObject;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;

import java.util.List;

//@Data
@Getter
@Setter
public class LineScoreQuery {
    private Long lineId;
    private JSONObject lineNameLocales;
    private List<RobotSocreQuery> children;

//    public void setLineNameLocales(JSONObject lineNameLocales) {
//        this.lineNameLocales = lineNameLocales;
//    }

    public void setLineNameLocales(String lineNameLocales) {
        if (StringUtils.isNotBlank(lineNameLocales)) {
            this.lineNameLocales = JSONObject.parseObject(lineNameLocales);
        } else {
            this.lineNameLocales = null;
        }
    }
}
